Skip to content

New script: 'transfer_hierarchy'.#234

Merged
wpferguson merged 3 commits intodarktable-org:masterfrom
schwerdf:master
Mar 16, 2020
Merged

New script: 'transfer_hierarchy'.#234
wpferguson merged 3 commits intodarktable-org:masterfrom
schwerdf:master

Conversation

@schwerdf
Copy link
Copy Markdown
Contributor

The recent debates over file management on the mailing list indicate that some other Darktable users would have a use for this script that I wrote for rapid archiving of photos.

Darktable's built-in batch move and copy functionality only allows one destination directory per batch (analogous to a mv or cp command applied to a list of files). This script moves or copies selected images to a new location in one batch while preserving their relative positions in the directory hierarchy (analogous to a mv or cp command applied to the directory that is the images' lowest-common-ancestor).

end
job.valid = false
local filterRules = darktable.gui.libs.collect.filter()
darktable.gui.libs.collect.filter(filterRules)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a copy from a collection to a new collection. After the copy I expected to end up at the destination, but the existing root just got refreshed and set to the top of the collection. Would it be better to end up at the destination after a move or copy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the view on the source was done on account of there being no single "destination" directory for the images, so the only possible collection change would be to a collect-by-film-roll on the destination root, which in my case is an already-well-populated archive. Finding the freshly moved or copied images among all the images there is like finding a needle in a haystack.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense


darktable.register_lib(LIB_ID,
"transfer hierarchy", true, true, {
[darktable.gui.views.lighttable] = { "DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 1000 }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the position to 700 puts transfer_hierarchy just below select, and selected_images. 1000 puts it at the top, above select, which might come as a surprise to users.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 0501758.

-- Widgets and business logic: BEGIN

local sourceTextBox = darktable.new_widget("entry") {
tooltip = "Lowest directory containing all selected images",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make strings translatable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit 0501758.

…cted image[s]'; added a translatability layer for strings; corrected behavior in the case of images with multiple versions.
@wpferguson wpferguson merged commit 1ec9cfb into darktable-org:master Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants